package com.zyj.jetpackdemo.moudle

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.runtime.Composable
import com.zyj.jetpackdemo.MenuLists

import com.zyj.jetpackdemo.mainMenuList
import com.zyj.jetpackdemo.ui.theme.ComposeExampleTheme

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            ComposeExampleTheme {
                // A surface container using the 'background' color from the theme
                Surface(color = MaterialTheme.colors.background) {
                    Greeting(this)
                }
            }
        }
    }
}


@Composable
fun Greeting(activity: Activity) {
    val intent = Intent(activity, ComposeListsActivity::class.java)
    MenuLists(items = mainMenuList, intent, activity)
}


